package com.qiaoba.module.job.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.qiaoba.common.database.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 定时任务
 *
 * @author ailanyin
 * @date 2023-09-03 21:52:54
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sys_job")
@NoArgsConstructor
public class SysJob extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @TableId
    @Schema(description = "任务ID")
    private String jobId;

    @Excel(name = "任务名称", width = 20)
    @Schema(description = "任务名称")
    private String jobName;

    @Excel(name = "任务分组", width = 20)
    @Schema(description = "任务分组")
    private String jobGroup;

    @Excel(name = "执行类方法", width = 30)
    @Schema(description = "执行类方法")
    private String invokeTarget;

    @Excel(name = "Cron表达式", width = 20)
    @Schema(description = "Cron表达式")
    private String cronExpression;

    @Excel(name = "计划策略", width = 20, replace = {"默认执行_0", "立即触发执行_1", "触发一次执行_2", "不触发立即执行_3"})
    @Schema(description = "cron计划策略 0=默认,1=立即触发执行,2=触发一次执行,3=不触发立即执行")
    private String misfirePolicy;

    @Excel(name = "并发执行", replace = {"允许_1", "禁止_0"})
    @Schema(description = "是否并发执行（1允许 0禁止）")
    private String concurrent;

    @Excel(name = "状态", replace = {"正常_1", "暂停_0"})
    @Schema(description = "任务状态（1正常 0暂停）")
    private String status;

}
